package com.zy.web.demo.duoxiancheng.demo33;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/9/29 15:59
 */
public class Service33 {

    private ReentrantLock lock = new ReentrantLock();
    private Condition condition = lock.newCondition();

    public void mehthod(){
        lock.lock();
        try {
            System.out.println("begin");
            condition.awaitUninterruptibly();
            System.out.println("end");
        } finally {
            lock.unlock();
        }
    }

}
